{literal}
<script type="text/javascript">

function filldays(count) {
	var replacement = '';
	for(var i = 1; i <= count; i++) {
		replacement = replacement + '<option>' + i + '</option>';
	}

	if($('#bday').children().length != count)$('#bday').empty().append(replacement);


}

$(document).ready(function(){
	$('.bdate').change(function(){
		switch(parseInt($('#bmonth').val())) {
			case 1:
			case 3:
			case 5:
			case 7:
			case 8:
			case 10:
			case 12:
				filldays(31);
				break;
			case 2:

				if(parseInt($('#byear').val()) % 4 == 0 && parseInt($('#byear').val()) % 100 != 0 ) {
					filldays(29);
				} else {
					filldays(28);
				}
				break;
			default:
				filldays(30);
		}
	});

	$('#quiz_1').validate({
		errorElement: "p",
		errorClass: "warning"
	});
});

</script>
{/literal}
<div class="panelTabs">
	<div class="tabs">
		<a class="label" title="Categories">{'Quick Rocket Finder'|t}</a>
	</div>
</div>
<div class="backgroundFrame970Top"></div>
<div class="backgroundFrame970">
	<div class="content">

		<h1>{'Thank you for using “Quick Racquet Finder” tool. We are happy to assist you in racquet selection process. It wil take only a few moments to view your recommended racquet list:'|t}</h1>

				<div class="panelQuiz">

					<div class="form">
						<form method="post" id="quiz_1" name="quiz_1" action="{url label=quizQuickRocketFinderResults}" >
							<div class="formItem"><p>{'Gender'|t}</p>
							<input type="radio" name="gender" value="1" id="male" class="radio required" checked="checked"/><label for="male">male</label>
							<input type="radio" name="gender" value="2" id="female" class="radio required"/><label for="female">female</label>
							</div>
							<div class="formItem"><p>{'Birthdate'|t}</p>
							<select name="year" id="byear" class="defSelect bdate">
								{section name=years loop=150}
								<option>{math equation="y - x" x=$smarty.section.years.index y=2011}</option>
								{/section}
							</select>

							<select name="month" id="bmonth" class="defSelect bdate">
								<option value="1">{'January'|t}</option>
								<option value="2">{'February'|t}</option>
								<option value="3">{'March'|t}</option>
								<option value="4">{'April'|t}</option>
								<option value="5">{'May'|t}</option>
								<option value="6">{'June'|t}</option>
								<option value="7">{'July'|t}</option>
								<option value="8">{'August'|t}</option>
								<option value="9">{'September'|t}</option>
								<option value="10">{'October'|t}</option>
								<option value="11">{'November'|t}</option>
								<option value="12">{'December'|t}</option>
							</select>

							<select name="day" id="bday" class="defSelect">
								{section name=days loop=32 max=31 start=1}
								<option>{if $smarty.section.days.index < 10}0{/if}{$smarty.section.days.index}</option>
								{/section}
							</select>
							</div>
							<div class="formItem formItemSpacer"><p>{'Weight'|t}</p><input type="text" name="weight" id="weight" value="" style="width: 50px;" maxlength="3" class="required"/> {if $_display_metric_system_type eq 1}{'lb'|t}{else}{'kg'|t}{/if}
							</div>
							<div class="formItem"><p>{'Height'|t}</p><input type="text" name="height" id="height" value="" style="width: 50px;" maxlength="3" class="required"/> {if $_display_metric_system_type eq 1}{'"'|t}{else}{'cm'|t}{/if}
							</div>


							<div class="clearBoth"></div>

							<div class="formItem formItemSpacer"><p>{'NTRP Level'|t}<br/><!--<a href="ntrp.html" title="How to set NTRP Level?" target="_blank">{'How to set NTRP Level?'|t}</a>--></p></div>
							<div class="slider sliderQuiz" >
									{literal}<script type="text/javascript">
									$(function() {
										$('#ntrp').sliders({min_value: 1, max_value:7, value_type: 'float', label:'', scale_image: '{/literal}{$urlStatic}/image/Strona/ruler17.png{literal}', bg_image: '{/literal}{$urlStatic}/image/Strona/rainbow.png{literal}'});
									})
								</script>{/literal}
								<input type="hidden" name="ntrp" id="ntrp" value="{if $_userLoggedIn}{$_user->userExtendedProfile->getNtrp()}{else}1{/if}"/>
							</div>

							<div class="clearBoth"></div>

							<div class="formSubmit "><input type="submit" name="submitForm" value="{'view racquet list'|t}"/></div>
						</form>
					</div>
				</div>

			<div class="clearBoth"></div>


	</div>
</div>
<div class="backgroundFrame970Bottom"></div>

{if $_userLoggedIn}
<script type="text/javascript">
	var weight = '{$_user->getWeight()}';
	var height = '{$_user->getHeight()}';
	var gender = '{$_user->getGender()}';
	var byear = '{$_user->getBirthDate('year')}';
	var bmonth = '{$_user->getBirthDate('month')}';
	var bday = '{$_user->getBirthDate('day')}';
{literal}
	$(document).ready(function(){
	document.forms['quiz_1'].gender.value = gender;
	document.forms['quiz_1'].weight.value = weight;
	document.forms['quiz_1'].height.value = height;
		document.forms['quiz_1'].year.value = byear;
			document.forms['quiz_1'].month.value = bmonth;
				document.forms['quiz_1'].day.value = bday;
	});
{/literal}
</script>
{/if}


